home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Mode Examples / Omega-Example2.opl < prev    next >
Encoding:
Text File  |  2000-10-30  |  14.6 KB  |  496 lines

  1. % -*-Omg-*-
  2.  
  3. % Omega-Example.opl
  4. % This is a sample file for the Omega mode with Alpha. 
  5. % The features which are herein described will work only if Omega Mode
  6. % has been properly installed.
  7. % - the first line of this file says 
  8. % -*-Omg-*- 
  9. % It is a magic syntax to establish the Omega mode in your file (otherwise
  10. % it would normally be in TeX mode since the file would have a .tex
  11. % extension).  It is inserted with the 'Set Omega Mode' menu item.
  12. % - syntax coloring : the usual TeX/LaTeX commands are colored in blue. 
  13. % The typical Omega commands are in magenta.
  14. % - the 'M' pop-up menu contains the list of the various packages, ocp's
  15. % and ocplists used in this file.
  16. % - the '{}' pop-up menu works like with TeX mode.
  17. % - if you option-click on the title bar, a list of all the .tex, .otp and
  18. % .log files in the current directory (if any) will show up.
  19. % - toggle TeX and Omega mode with the following key combinations :
  20. % escape-t and escapte-o.
  21. % - there is also a sophisticated system of completions and abbreviations
  22. % in Omega Mode (please read the Omega Help File).  For instance, if the
  23. % 'elecCompletion' package is activated, typing 'rbo' and hitting the 'F1'
  24. % key will result in \removebeforeocplist.  Very handy for these long
  25. % commands.  Typing 'rem' and the 'F1' key will complete to '\remove' ;
  26. % hitting the F1 key again will bring a list of various possibilities to
  27. % complete the word : removeafter, removeafterocplist, removebeforeocplist. 
  28. % It is not necessary to type the backslash : Omega Mode will insert it
  29. % automatically when completing.  See the doc for more.
  30. % Please see the Otp-Example.otp and Opl-Example.opl sections (below) for
  31. % more examples about Omega Mode.
  32. % Omega Mode is under development (as is Omega itself).  
  33. % Please check for the latest version of Omega Mode at :
  34. % <http://perso.easynet.fr/~berdesg/omega.html>
  35.  
  36. % This example comes in three parts.  The first is an excerpt of the
  37. % torture.tex file written by Yannis Haralambous and John Plaice and
  38. % provided with the Omega distribution.
  39.  
  40.  
  41. \documentclass[a4paper,11pt]{article}
  42. \usepackage{amsmath}
  43. \usepackage{omega}
  44.  
  45. \def\shortarab#1{{\pushocplist\ArabicOCP\fontfamily{omarb}\selectfont#1\popocplist}}
  46. \def\shortberber#1{{\pushocplist\ArabicBerberOCP\fontfamily{omarb}\selectfont#1\popocplist}}
  47. \def\shortgreek#1{{\pushocplist\GreekOCP\fontfamily{omlgc}\selectfont#1\popocplist}}
  48. \def\shortlatberber#1{{\pushocplist\LatinBerberOCP\fontfamily{omlgc}\selectfont#1\popocplist}}
  49. \def\shorttifi#1{{\pushocplist\TifinaghOCP\fontfamily{omlgc}\selectfont#1\popocplist}}
  50. \def\shortpashto#1{{\pushocplist\AfghaPashtoOCP\fontfamily{omarb}\selectfont#1\popocplist}}
  51.  
  52. [snip] 
  53.  
  54. \begin{document}
  55. \title{Multilingual Typesetting with \OMEGA, a Case Study: Arabic}
  56. \date{}
  57. \maketitle
  58.  
  59. [snip] 
  60.  
  61.  
  62. \section{Overview of the \OMEGA{} Arabic Script Package}
  63.  
  64. Typesetting with \OMEGA{} is a process similar to typesetting with
  65. \TeX: the user prepares a ``source'' file, containing the text of
  66. \hisher{} document and a certain number of macro-commands for
  67. attribute changes of the text (font characteristics, language, case,
  68. etc.), references to figures (included in graphical format files on
  69. disk) and other material included in or accompanying the text.
  70.  
  71. Once this source file prepared, \OMEGA{} is launched: it reads the
  72. file, expands the commands and typesets the text accordingly. To
  73. perform this task, \OMEGA{} loads and executes several \OTP{}s
  74. (\OMEGA{} Translation Processes), which take care of low level
  75. properties of the document (contextual analysis of the script, case
  76. switching according to script and language, etc.). It also uses
  77. different fonts, most of which are \emph{virtual}, in the sense that
  78. they themselves call other fonts. On a higher level, such a document
  79. uses \LaTeX{} packages, some of them modified to take advantage of the
  80. additional features of \OMEGA{} vs.\ \TeX.
  81.  
  82. [snip] 
  83.  
  84. {\pardir TRT\textdir TRT\pushocplist\ArabicOCP\fontfamily{omarb}\selectfont
  85. \begin{center}\begin{tabular}{|c|c|}\hline
  86. {\textdir TRT HayA"t} & {\textdir TRT mayyit}\\\hline
  87. {\mathdir TLT$\displaystyle\int_{\text{\textdir TRT Sif<>r}}^{\hbox dir TRT{\textdir TRT ghyr maH<>duUd}}f(x)\,dx$} & {\textdir TRT 'aanA}\\\hline
  88. \end{tabular}\end{center}
  89. \popocplist}
  90.  
  91. There are two key aspects to Arabic script typesetting,
  92. unfortunately of unequal complexity: the first one is contextual
  93. analysis, that is the fact that Arabic letters change shape according
  94. to their position in a word, or according to the fact that they are
  95. part of an abbreviation, etc. This aspect can be handled easily and
  96. efficiently by \OTP{}s.  The second aspect is more global: it is the
  97. fact that Arabic script is written from right to left.
  98.  
  99.  
  100. [snip] 
  101.  
  102.  
  103. \section{Parts of the \OMEGA{} Arabic Script Package}
  104.  
  105. This package consists of the following elements:
  106.  
  107.  
  108. [snip] 
  109.  
  110.  
  111. \section{Installation of the \OMEGA{} Arabic Script Package}
  112.  
  113. To use the \OMEGA{} Arabic Script Package you must have \OMEGA{}
  114. version 1.45 or higher installed on your machine. Place OFM, OVF, TFM
  115. and OCP files where the system expects to find them (if in doubt,
  116. consult the \texttt{texmf.conf} file). Keep the \texttt{arabic.sty}
  117. file somewhere where it can be found by \OMEGA{}. Finally add the
  118. following few lines to the \texttt{psfonts.map} configuration file of
  119. \texttt{odvips}etc.
  120.  
  121.  
  122. [snip] 
  123.  
  124.  
  125. \section{Basic Macros}
  126.  
  127.  
  128. [snip] 
  129.  
  130.  
  131. {\pardir TRT\textdir TRT
  132. \begin{center}
  133. \begin{arab}
  134. \Huge
  135. 'aahlAaN wa sahlAaN!
  136. \end{arab}
  137. \end{center}
  138. }
  139.  
  140. \noindent
  141. Example of vowelized Arabic:\\[8pt]
  142.  
  143. {\pardir TRT\textdir TRT
  144. \begin{quote}
  145. \pushocplist\ArabicOCP\fontfamily{omarb}\selectfont\LARGE li'aannahaA
  146. "Al<>'Ana laA tufakkiru fiI naf<>sihaA, walakinnahaA tufakkiru fiI
  147. 'aakhaway<>haA wafiI "Al<>khaTari "AlladhiI laHiqahumaA.  \popocplist
  148. \end{quote}
  149. }
  150.  
  151.  
  152. [snip] 
  153.  
  154.  
  155. \subsubsection{Berber Transcription}
  156.  
  157.  
  158. [snip] 
  159.  
  160.  
  161. \noindent
  162. Example: 
  163.  
  164. {\pardir TRT\textdir TRT
  165. \begin{quote}
  166. \pushocplist\ArabicBerberOCP\fontfamily{omarb}\selectfont Tifinagh,
  167. d--tira timezwura n .imazighen.  Llant di tmurt--nnegh dat tira n
  168. ta.erabt d--tla.tinit. Nnulfant--edd dat .imir n ugellid
  169. Masinisen. .Imazighen n .imir--en, ttarun--tent ghefi.zra, degg
  170. .ifran, ghef .igduren, maca tiggti ghef i.zekwan~: ttarun fell--asen
  171. .isem n umettin, d wi--t--ilan, d wayen yexdem di tudert--is akken ur
  172. t ttettun .ina.tfaren.  \popocplist
  173. \end{quote}}
  174.  
  175.  
  176. [snip] 
  177.  
  178.  
  179. \section{Writing Your Own Transcription}\label{writingOTPs}
  180.  
  181. We have developed and presented in this paper a certain number of
  182. Arabic alphabet language transcriptions for two reasons: first, to
  183. show the possibilities and power of \OMEGA, and second, to give a
  184. starting point for the user to create \hisher{} own transcriptions.
  185.  
  186. [snip] 
  187.  
  188.  
  189. \begin{verbatim}
  190. \ocp\ArabUni=7arb2uni
  191. \ocp\UniCUni=uni2cuni
  192. \ocp\CUniArab=cuni2oar
  193. \ocplist\ArabicOCP=
  194. \addbeforeocplist 100 \ArabUni
  195. \addbeforeocplist 200 \UniCUni
  196. \addbeforeocplist 300 \CUniArab
  197. \nullocplist
  198. \pushocplist\ArabicOCP
  199. \end{verbatim}
  200.  
  201. \noindent is sufficient to load all \OTP{}s necessary for typesetting
  202. in the Arabic language.
  203.  
  204. \section{Availability and Further Information}
  205.  
  206.  
  207. [snip] 
  208.  
  209.  
  210. \newpage
  211. \pagedir TRT
  212. \bodydir TRT
  213. \pardir TRT
  214. \textdir TRT
  215. \def\latinit#1{{\fontfamily{omlgc}\selectfont\pushocplist\BasicLatinOCP%
  216. \textdir TLT #1\popocplist}}
  217. \def\rmdefault{omarb}
  218. \fontfamily{omarb}\selectfont
  219. \pushocplist\ArabicOCP
  220.  
  221.  
  222. \subsection{'aTfAl AlghAb"t}
  223.  
  224. kAn l'aHd AlmlUk AlqdmA|| 'akht t`ysh m`h fI qSrh, b`d 'an mAt-t
  225. zUjt-h, wtrkt lh mn Al'awlAd thlAth"t: 'amyryn w'amyr"t. wqd AzdAd Hbb
  226. Almlk l'awlAd-h, b`d wfA"t wAldt-hm Almlk"t, w'aHbbhm HbbA kthyrA;
  227. ly`wwDhm mA fqdUh mn `Tf 'ammhm wHbbhA lhm, wtfkyr hA fyhm; fkAn ys'al
  228. `nhm kllmA HDr, wyfkkr fyhm kllmA dkhl, wywSI bhm kllmA khrj, wyTlbhm
  229. kllmA jls ltnAwl T`Am Al'ifTAr 'aU AlghdA|| 'aU AlshshAI 'aU Al`shA||.
  230.  
  231.  
  232. [snip] 
  233.  
  234. \popocplist
  235.  
  236. \pushocplist\ArabicBerberOCP
  237.  
  238. \subsection{Allal i useqdc n y.drisn \OMEGA\ d-tamazight}
  239.  
  240. A dd nessken s wayes yif useqdec n \OMEGA\ i tira s tutlayt tamazight,
  241. ama s tifinagh, ama s isekkilen ila.taniyen. Newwi-dd tamazight am,
  242. tutlayt yeddren (yettwarun s tifinagh tiynayin)~: izmer umdan ad
  243. iseddu yall tighura n usuddes n tira, i waraten ussnanen, itekniken
  244. negh i wid n tsikkla, am wid ssexdamen i usemsaru n tfransist.
  245.  
  246.  
  247. [snip] 
  248.  
  249. \popocplist
  250.  
  251. \pushocplist\SindhiOCP
  252. \subsection{ktyn kr mU.ryA j.=d-hn}
  253.  
  254. tn-hn kry AsAn khy pn-hnjy =z-hnn khy sjA=g rkh'nU pUndU ||eN pn-hnjy
  255. jdUj-hd meN .=dA-hp pydA kr'ny. AhU b/ m`lUm kr'nU pUndU t/ sndh meN
  256. hr 'A'yy wqt chA chA thy r-hyU 'Ahy ||eN dshmn AsAn jy ||eN AsAn jy
  257. jdUj-hd jy khlAf k-h.rA k-h.rA g-hA.t g-h.ry r-hyU 'Ahy.
  258.  
  259. [snip] 
  260.  
  261. \popocplist
  262.  
  263. \end{document} 
  264.  
  265.  
  266. % Omega-Example.opl
  267. % This is a sample (not real life) opl file for the Omega mode with Alpha. It
  268. % is an excerpt of ucvtt10.opl. The features which are herein described  will
  269. % work only if omegaMode has been properly installed.
  270. % - the Omega mode is established automatically thanks to the .opl  extension
  271. % in the file's name.
  272. % - syntax coloring : the typical Property List keywords are  in  green.  See
  273. % the mode preferences to customize this.
  274. % - the 'M' pop-up menu helps you to navigate in the file : it lists all  the
  275. % FONTDIMEN, LIGTABLE and all the characters.
  276. % Please see the OmegaSample.tex and OplSample.opl files  for  more  examples
  277. % about Omega Mode.
  278.  
  279.  
  280. (OFMLEVEL H 0)
  281. (FONTDIR TL)
  282. (FAMILY OMEGA SERIF)
  283. (FACE F MRR)
  284. (CODINGSCHEME OMEGA-LGC)
  285. (DESIGNSIZE R 10.0)
  286. (COMMENT DESIGNSIZE IS IN POINTS)
  287. (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
  288. (CHECKSUM H 956D535D)
  289. (SEVENBITSAFEFLAG FALSE)
  290. (FONTDIMEN
  291.    (SLANT R 0.0)
  292.    (SPACE R 0.3)
  293.    (STRETCH R 0.15)
  294.    (SHRINK R 0.1)
  295.    (XHEIGHT R 0.459)
  296.    (QUAD R 1.0)
  297.    (EXTRASPACE R 0.111112)
  298.    )
  299. (LIGTABLE
  300.    (LABEL H 41)
  301.    (KRN H 43 R -0.02917)
  302.    (KRN H 47 R -0.02917)
  303.    (KRN H 4F R -0.02917)
  304.    (KRN H 51 R -0.02917)
  305.    (KRN H 54 R -0.0875)
  306.    (KRN H 55 R -0.02917)
  307.    (KRN H 56 R -0.11667)
  308.    (KRN H 57 R -0.11667)
  309.    (KRN H 59 R -0.0875)
  310.    (KRN H 74 R -0.02917)
  311.    (KRN H D8 R -0.02917)
  312.    (KRN H 152 R -0.02917)
  313.    (STOP)
  314.    (LABEL H 44)
  315.    (KRN H 41 R -0.02917)
  316.    (KRN H 56 R -0.02917)
  317.    (KRN H 57 R -0.02917)
  318.    (KRN H 58 R -0.02917)
  319.    (KRN H 59 R -0.02917)
  320.    (KRN H C6 R -0.02917)
  321.    (STOP)
  322.  
  323. [snip] 
  324.  
  325.  
  326.    )
  327. (CHARACTER H 21
  328.    (CHARWD R 0.29167)
  329.    (CHARHT R 0.622)
  330.    )
  331. (CHARACTER H 22
  332.    (CHARWD R 0.525)
  333.    (CHARHT R 0.611)
  334.    (CHARDP R 0.368)
  335.    )
  336. (CHARACTER H 23
  337.    (CHARWD R 0.875)
  338.    (CHARHT R 0.611)
  339.    )
  340.  
  341. [snip] 
  342.  
  343.  
  344. (CHARACTER H 41
  345.    (CHARWD R 0.75833)
  346.    (CHARHT R 0.623)
  347.    (COMMENT
  348.       (KRN H 43 R -0.02917)
  349.       (KRN H 47 R -0.02917)
  350.       (KRN H 4F R -0.02917)
  351.       (KRN H 51 R -0.02917)
  352.       (KRN H 54 R -0.0875)
  353.       (KRN H 55 R -0.02917)
  354.       (KRN H 56 R -0.11667)
  355.       (KRN H 57 R -0.11667)
  356.       (KRN H 59 R -0.0875)
  357.       (KRN H 74 R -0.02917)
  358.       (KRN H D8 R -0.02917)
  359.       (KRN H 152 R -0.02917)
  360.       )
  361.    )
  362. (CHARACTER H 42
  363.    (CHARWD R 0.72917)
  364.    (CHARHT R 0.611)
  365.    )
  366.  
  367. [snip] 
  368.  
  369.  
  370. (CHARACTER H 1018
  371.    (CHARWD R 0.29167)
  372.    (CHARHT R 0.611)
  373.    (CHARDP R 0.368)
  374.    )
  375. (CHARACTER H 1019
  376.    (CHARWD R 0.29167)
  377.    (CHARHT R 0.611)
  378.    (CHARDP R 0.368)
  379.    (COMMENT
  380.       (KRN H 21 R 0.11667)
  381.       (KRN H 3F R 0.11667)
  382.       )
  383.    )
  384.  
  385.  
  386. % Omega-Example.otp
  387. % Omega Translation Process File
  388. %
  389. % This is a sample (not real life) file for the Omega mode with Alpha.  The
  390. % features which are herein described will work only if omegaMode has been
  391. % properly installed.
  392. % - the Omega mode is established automatically thanks to the .otp
  393. % extension in the file's name.  See the Otp Syntax submenu of Omega Menu
  394. % and try the various items.
  395. % - syntax coloring : the typical Omega keywords are in magenta.  Tables
  396. % are in red.  See the mode preferences to customize them.
  397. % - the Numbering submenu lets you choose the format for integer values
  398. % (dec, oct or hex)
  399. % - the 'M' pop-up menu helps you to navigate in the file : it lists all
  400. % the keywords and tables.
  401.  
  402. input: 1;
  403.  
  404. output: 2;
  405.  
  406. tables:
  407. sampTbl_1[@"28] ={
  408. @"044C, @"044B, @"0437, @"0448, @"044D, @"0449, @"0447, @"044A,
  409. @"042E, @"0410, @"0411, @"0426, @"0414, @"0415, @"0424, @"0413,
  410. @"0425, @"0418, @"0419, @"041A, @"041B, @"041C, @"041D, @"041E,
  411. @"041F, @"042F, @"0420, @"0421, @"0422, @"0423, @"0416, @"0412,
  412. @"042C, @"042B, @"0417, @"0428, @"042D, @"0429, @"0427, @"042A
  413. };
  414.  
  415.  
  416. sampTbl_2[@"111] ={
  417. @"003d, @"223c, @"2229, @"222a, @"22a5, @"2220, @"221f, @"22bf,
  418. @"33d2, @"33d1, @"222b, @"222e, @"2235, @"2234, @"2640, @"2642,
  419. @"2641, @"2609, @"2191, @"2193, @"2192, @"2190, @"2196, @"2197,
  420. @"2199, @"2198, @"2016, @"002c, @"ff0f, @"ff3c, @"002f, @"005c,
  421. @"ff04, @"00a5, @"3012, @"00a2, @"00a3, @"ff05, @"ff20, @"2103,
  422. @"2109, @"0024, @"0025, @"0040, @"33d5, @"339c, @"339d, @"339e,
  423. @"33ce, @"33a1, @"338e, @"338f, @"33c4, @"00b0, @"5159, @"515b,
  424. @"515e, @"515d, @"5161, @"5163, @"55e7, @"74e9, @"7cce, @"2581,
  425. @"2582, @"2583, @"2584, @"2585, @"2586, @"2587, @"2588, @"258f,
  426. @"258e, @"258d, @"258c, @"258b, @"258a, @"2589, @"253c, @"2534,
  427. @"252c, @"2524, @"251c, @"2594, @"2500, @"2502, @"2595, @"250c,
  428. @"2510, @"2514, @"2518, @"256d, @"256e, @"2570, @"256f, @"2550,
  429. @"255e, @"256a, @"2561, @"25e2, @"25e3, @"25e5, @"25e4, @"2571,
  430. @"2572, @"2573, @"ff10, @"ff11, @"ff12, @"ff13, @"ff14, @"ff15,
  431. @"ff16, @"ff17, @"ff18, @"ff19, @"2160, @"2161, @"2162, @"2163,
  432. @"2164, @"2165, @"2166, @"2167, @"2168, @"2169, @"3021, @"3022,
  433. @"3023, @"3024, @"3025, @"3026, @"3027, @"3028, @"3029, @"fffd,
  434. @"5344, @"fffd, @"ff21, @"ff22, @"ff23, @"ff24, @"ff25, @"ff26,
  435. @"ff27, @"ff28, @"ff29, @"ff2a, @"ff2b, @"ff2c, @"ff2d, @"ff2e,
  436. @"ff2f, @"ff30, @"ff31, @"ff32, @"ff33, @"ff34, @"ff35, @"ff36,
  437. @"ff37, @"ff38, @"ff39, @"ff3a, @"ff41, @"ff42, @"ff43, @"ff44,
  438. @"ff45, @"ff46, @"ff47, @"ff48, @"ff49, @"ff4a, @"ff4b, @"ff4c,
  439. @"ff4d, @"ff4e, @"ff4f, @"ff50, @"ff51, @"ff52, @"ff53, @"ff54,
  440. @"ff55, @"ff56, @"ff57, @"ff58, @"ff59, @"ff5a, @"0391, @"0392,
  441. @"0393, @"0394, @"0395, @"0396, @"0397, @"0398, @"0399, @"039a,
  442. @"039b, @"039c, @"039d, @"039e, @"039f, @"03a0, @"03a1, @"03a3,
  443. @"03a4, @"03a5, @"03a6, @"03a7, @"03a8, @"03a9, @"03b1, @"03b2,
  444. @"03b3, @"03b4, @"03b5, @"03b6, @"03b7, @"03b8, @"03b9, @"03ba,
  445. @"03bb, @"03bc, @"03bd, @"03be, @"03bf, @"03c0, @"03c1, @"03c3,
  446. @"03c4, @"03c5, @"03c6, @"03c7, @"03c8, @"03c9, @"3105, @"3106,
  447. @"3107, @"3108, @"3109, @"310a, @"310b, @"310c, @"310d, @"310e,
  448. @"310f, @"3110, @"3111, @"3112, @"3113, @"3114, @"3115, @"3116,
  449. @"3117, @"3118, @"3119, @"311a, @"311b, @"311c, @"311d, @"311e,
  450. @"311f, @"3120, @"3121, @"3122, @"3123, @"3124, @"3125, @"3126,
  451. };
  452.  
  453.  
  454. states: MEDIAL,NUMERAL;
  455.  
  456. aliases:
  457. UNIFORM          = (@"0621 | @"0674 | @"066E | @"066F | @"06EF | @"063F);
  458. SPECIAL           = (@"FDF2) ;
  459. BIFORM          = (@"0622-@"0625 | @"0627 | @"0629 | @"062F-@"0632 | @"0648 | 
  460.              @"0649 | @"065D | @"065E | 
  461.              @"0671-@"0673 | @"0675-@"0677 | @"0688-@"069A |
  462.              @"06BA | @"06C0-@"06CB | @"06CD | @"06D2 | @"06D3 |
  463.              @"06FF);
  464.  
  465. expressions:
  466.  
  467. @"00-@"7F    => \1;
  468. @"C0-@"FF    => #(sampTbl_1[\1-@"C0]);
  469. .        => @"FFFD;
  470.